import request from '@/utils/request'

// 查询问题列表
export function listCommunity(query) {
  return request({
    url: '/community/service/questions/list',
    method: 'get',
    params: query
  })
}

// 查询问题详细
export function getCommunity(id) {
  return request({
    url: '/community/service/questions/' + id,
    method: 'get'
  })
}

// 新增问题
export function addCommunity(data) {
  return request({
    url: '/community/service/questions',
    method: 'post',
    data: data
  })
}

// 修改问题
export function updateCommunity(data) {
  return request({
    url: '/community/service/questions',
    method: 'put',
    data: data
  })
}

// 删除问题
export function delCommunity(id) {
  return request({
    url: '/community/service/questions/' + id,
    method: 'delete'
  })
}

// 导出问题
export function exportCommunity(query) {
  return request({
    url: '/community/service/questions/export',
    method: 'get',
    params: query
  })
}

// 查询问题类型
export function getQuestionType() {
  return request({
    url: '/community/service/questions/type',
    method: 'get'
  })
}

// 添加问题类型
export function addQuestionType(data) {
  return request({
    url: '/community/service/questions/type',
    method: 'post',
    data: data
  })
}

// 查询申请问题列表
export function initApplyList(query) {
  return request({
    url: '/community/service/questions/apply/list',
    method: 'get',
    params: query
  })
}
